import 'package:distribution_mall_flutter/generated/json/base/json_convert_content.dart';
import 'package:distribution_mall_flutter/entity/goods/detail/goods_detail_entity.dart';

GoodsDetailEntity $GoodsDetailEntityFromJson(Map<String, dynamic> json) {
  final GoodsDetailEntity goodsDetailEntity = GoodsDetailEntity();
  final SuInfo? suInfo = jsonConvert.convert<SuInfo>(json['suInfo']);
  if (suInfo != null) {
    goodsDetailEntity.suInfo = suInfo;
  }
  final ItemInfo? itemInfo = jsonConvert.convert<ItemInfo>(json['itemInfo']);
  if (itemInfo != null) {
    goodsDetailEntity.itemInfo = itemInfo;
  }
  final bool? onSale = jsonConvert.convert<bool>(json['onSale']);
  if (onSale != null) {
    goodsDetailEntity.onSale = onSale;
  }
  final String? totalPrice = jsonConvert.convert<String>(json['totalPrice']);
  if (totalPrice != null) {
    goodsDetailEntity.totalPrice = totalPrice;
  }
  final bool? canOrder = jsonConvert.convert<bool>(json['canOrder']);
  if (canOrder != null) {
    goodsDetailEntity.canOrder = canOrder;
  }
  final String? reason = jsonConvert.convert<String>(json['reason']);
  if (reason != null) {
    goodsDetailEntity.reason = reason;
  }
  final bool? canInShopcart = jsonConvert.convert<bool>(json['canInShopcart']);
  if (canInShopcart != null) {
    goodsDetailEntity.canInShopcart = canInShopcart;
  }
  return goodsDetailEntity;
}

Map<String, dynamic> $GoodsDetailEntityToJson(GoodsDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['suInfo'] = entity.suInfo?.toJson();
  data['itemInfo'] = entity.itemInfo?.toJson();
  data['onSale'] = entity.onSale;
  data['totalPrice'] = entity.totalPrice;
  data['canOrder'] = entity.canOrder;
  data['reason'] = entity.reason;
  data['canInShopcart'] = entity.canInShopcart;
  return data;
}

extension GoodsDetailEntityExtension on GoodsDetailEntity {
  GoodsDetailEntity copyWith({
    SuInfo? suInfo,
    ItemInfo? itemInfo,
    bool? onSale,
    String? totalPrice,
    bool? canOrder,
    String? reason,
    bool? canInShopcart,
  }) {
    return GoodsDetailEntity()
      ..suInfo = suInfo ?? this.suInfo
      ..itemInfo = itemInfo ?? this.itemInfo
      ..onSale = onSale ?? this.onSale
      ..totalPrice = totalPrice ?? this.totalPrice
      ..canOrder = canOrder ?? this.canOrder
      ..reason = reason ?? this.reason
      ..canInShopcart = canInShopcart ?? this.canInShopcart;
  }
}

ItemInfo $ItemInfoFromJson(Map<String, dynamic> json) {
  final ItemInfo itemInfo = ItemInfo();
  final String? saleItemId = jsonConvert.convert<String>(json['saleItemId']);
  if (saleItemId != null) {
    itemInfo.saleItemId = saleItemId;
  }
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    itemInfo.title = title;
  }
  final String? codeEan = jsonConvert.convert<String>(json['codeEan']);
  if (codeEan != null) {
    itemInfo.codeEan = codeEan;
  }
  final String? codeUpc = jsonConvert.convert<String>(json['codeUpc']);
  if (codeUpc != null) {
    itemInfo.codeUpc = codeUpc;
  }
  final int? moq = jsonConvert.convert<int>(json['moq']);
  if (moq != null) {
    itemInfo.moq = moq;
  }
  final int? deliveryDays = jsonConvert.convert<int>(json['deliveryDays']);
  if (deliveryDays != null) {
    itemInfo.deliveryDays = deliveryDays;
  }
  final int? guarantyPeriod = jsonConvert.convert<int>(json['guarantyPeriod']);
  if (guarantyPeriod != null) {
    itemInfo.guarantyPeriod = guarantyPeriod;
  }
  final double? netWeight = jsonConvert.convert<double>(json['netWeight']);
  if (netWeight != null) {
    itemInfo.netWeight = netWeight;
  }
  final double? sizeLength = jsonConvert.convert<double>(json['sizeLength']);
  if (sizeLength != null) {
    itemInfo.sizeLength = sizeLength;
  }
  final double? sizeWidth = jsonConvert.convert<double>(json['sizeWidth']);
  if (sizeWidth != null) {
    itemInfo.sizeWidth = sizeWidth;
  }
  final double? sizeHeight = jsonConvert.convert<double>(json['sizeHeight']);
  if (sizeHeight != null) {
    itemInfo.sizeHeight = sizeHeight;
  }
  final double? grossWeight = jsonConvert.convert<double>(json['grossWeight']);
  if (grossWeight != null) {
    itemInfo.grossWeight = grossWeight;
  }
  final double? packingLength = jsonConvert.convert<double>(
      json['packingLength']);
  if (packingLength != null) {
    itemInfo.packingLength = packingLength;
  }
  final double? packingWidth = jsonConvert.convert<double>(
      json['packingWidth']);
  if (packingWidth != null) {
    itemInfo.packingWidth = packingWidth;
  }
  final double? packingHeight = jsonConvert.convert<double>(
      json['packingHeight']);
  if (packingHeight != null) {
    itemInfo.packingHeight = packingHeight;
  }
  final String? measuringUnit = jsonConvert.convert<String>(
      json['measuringUnit']);
  if (measuringUnit != null) {
    itemInfo.measuringUnit = measuringUnit;
  }
  final List<ItemInfoSpec>? specs = (json['specs'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<ItemInfoSpec>(e) as ItemInfoSpec).toList();
  if (specs != null) {
    itemInfo.specs = specs;
  }
  final double? salePrice = jsonConvert.convert<double>(json['salePrice']);
  if (salePrice != null) {
    itemInfo.salePrice = salePrice;
  }
  final String? salePriceCurrency = jsonConvert.convert<String>(
      json['salePriceCurrency']);
  if (salePriceCurrency != null) {
    itemInfo.salePriceCurrency = salePriceCurrency;
  }
  final double? displaySalePrice = jsonConvert.convert<double>(
      json['displaySalePrice']);
  if (displaySalePrice != null) {
    itemInfo.displaySalePrice = displaySalePrice;
  }
  final String? displaySalePriceCurrency = jsonConvert.convert<String>(
      json['displaySalePriceCurrency']);
  if (displaySalePriceCurrency != null) {
    itemInfo.displaySalePriceCurrency = displaySalePriceCurrency;
  }
  return itemInfo;
}

Map<String, dynamic> $ItemInfoToJson(ItemInfo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['saleItemId'] = entity.saleItemId;
  data['title'] = entity.title;
  data['codeEan'] = entity.codeEan;
  data['codeUpc'] = entity.codeUpc;
  data['moq'] = entity.moq;
  data['deliveryDays'] = entity.deliveryDays;
  data['guarantyPeriod'] = entity.guarantyPeriod;
  data['netWeight'] = entity.netWeight;
  data['sizeLength'] = entity.sizeLength;
  data['sizeWidth'] = entity.sizeWidth;
  data['sizeHeight'] = entity.sizeHeight;
  data['grossWeight'] = entity.grossWeight;
  data['packingLength'] = entity.packingLength;
  data['packingWidth'] = entity.packingWidth;
  data['packingHeight'] = entity.packingHeight;
  data['measuringUnit'] = entity.measuringUnit;
  data['specs'] = entity.specs?.map((v) => v.toJson()).toList();
  data['salePrice'] = entity.salePrice;
  data['salePriceCurrency'] = entity.salePriceCurrency;
  data['displaySalePrice'] = entity.displaySalePrice;
  data['displaySalePriceCurrency'] = entity.displaySalePriceCurrency;
  return data;
}

extension ItemInfoExtension on ItemInfo {
  ItemInfo copyWith({
    String? saleItemId,
    String? title,
    String? codeEan,
    String? codeUpc,
    int? moq,
    int? deliveryDays,
    int? guarantyPeriod,
    double? netWeight,
    double? sizeLength,
    double? sizeWidth,
    double? sizeHeight,
    double? grossWeight,
    double? packingLength,
    double? packingWidth,
    double? packingHeight,
    String? measuringUnit,
    List<ItemInfoSpec>? specs,
    double? salePrice,
    String? salePriceCurrency,
    double? displaySalePrice,
    String? displaySalePriceCurrency,
  }) {
    return ItemInfo()
      ..saleItemId = saleItemId ?? this.saleItemId
      ..title = title ?? this.title
      ..codeEan = codeEan ?? this.codeEan
      ..codeUpc = codeUpc ?? this.codeUpc
      ..moq = moq ?? this.moq
      ..deliveryDays = deliveryDays ?? this.deliveryDays
      ..guarantyPeriod = guarantyPeriod ?? this.guarantyPeriod
      ..netWeight = netWeight ?? this.netWeight
      ..sizeLength = sizeLength ?? this.sizeLength
      ..sizeWidth = sizeWidth ?? this.sizeWidth
      ..sizeHeight = sizeHeight ?? this.sizeHeight
      ..grossWeight = grossWeight ?? this.grossWeight
      ..packingLength = packingLength ?? this.packingLength
      ..packingWidth = packingWidth ?? this.packingWidth
      ..packingHeight = packingHeight ?? this.packingHeight
      ..measuringUnit = measuringUnit ?? this.measuringUnit
      ..specs = specs ?? this.specs
      ..salePrice = salePrice ?? this.salePrice
      ..salePriceCurrency = salePriceCurrency ?? this.salePriceCurrency
      ..displaySalePrice = displaySalePrice ?? this.displaySalePrice
      ..displaySalePriceCurrency = displaySalePriceCurrency ??
          this.displaySalePriceCurrency;
  }
}

ItemInfoSpec $ItemInfoSpecFromJson(Map<String, dynamic> json) {
  final ItemInfoSpec itemInfoSpec = ItemInfoSpec();
  final String? specName = jsonConvert.convert<String>(json['specName']);
  if (specName != null) {
    itemInfoSpec.specName = specName;
  }
  final String? specValue = jsonConvert.convert<String>(json['specValue']);
  if (specValue != null) {
    itemInfoSpec.specValue = specValue;
  }
  final String? specType = jsonConvert.convert<String>(json['specType']);
  if (specType != null) {
    itemInfoSpec.specType = specType;
  }
  return itemInfoSpec;
}

Map<String, dynamic> $ItemInfoSpecToJson(ItemInfoSpec entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['specName'] = entity.specName;
  data['specValue'] = entity.specValue;
  data['specType'] = entity.specType;
  return data;
}

extension ItemInfoSpecExtension on ItemInfoSpec {
  ItemInfoSpec copyWith({
    String? specName,
    String? specValue,
    String? specType,
  }) {
    return ItemInfoSpec()
      ..specName = specName ?? this.specName
      ..specValue = specValue ?? this.specValue
      ..specType = specType ?? this.specType;
  }
}

SuInfo $SuInfoFromJson(Map<String, dynamic> json) {
  final SuInfo suInfo = SuInfo();
  final String? title = jsonConvert.convert<String>(json['title']);
  if (title != null) {
    suInfo.title = title;
  }
  final String? categoryId = jsonConvert.convert<String>(json['categoryId']);
  if (categoryId != null) {
    suInfo.categoryId = categoryId;
  }
  final String? categoryName = jsonConvert.convert<String>(
      json['categoryName']);
  if (categoryName != null) {
    suInfo.categoryName = categoryName;
  }
  final String? brandId = jsonConvert.convert<String>(json['brandId']);
  if (brandId != null) {
    suInfo.brandId = brandId;
  }
  final String? brandName = jsonConvert.convert<String>(json['brandName']);
  if (brandName != null) {
    suInfo.brandName = brandName;
  }
  final String? brandLogo = jsonConvert.convert<String>(json['brandLogo']);
  if (brandLogo != null) {
    suInfo.brandLogo = brandLogo;
  }
  final String? sellingPointDesc = jsonConvert.convert<String>(
      json['sellingPointDesc']);
  if (sellingPointDesc != null) {
    suInfo.sellingPointDesc = sellingPointDesc;
  }
  final ShippingInfo? shippingInfo = jsonConvert.convert<ShippingInfo>(
      json['shippingInfo']);
  if (shippingInfo != null) {
    suInfo.shippingInfo = shippingInfo;
  }
  final bool? isCanCod = jsonConvert.convert<bool>(json['isCanCod']);
  if (isCanCod != null) {
    suInfo.isCanCod = isCanCod;
  }
  final bool? sample = jsonConvert.convert<bool>(json['sample']);
  if (sample != null) {
    suInfo.sample = sample;
  }
  final List<String>? mainImages = (json['mainImages'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (mainImages != null) {
    suInfo.mainImages = mainImages;
  }
  final List<SuInfoSpec>? specs = (json['specs'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<SuInfoSpec>(e) as SuInfoSpec).toList();
  if (specs != null) {
    suInfo.specs = specs;
  }
  final List<Param>? params = (json['params'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<Param>(e) as Param).toList();
  if (params != null) {
    suInfo.params = params;
  }
  final String? textDesc = jsonConvert.convert<String>(json['textDesc']);
  if (textDesc != null) {
    suInfo.textDesc = textDesc;
  }
  final List<dynamic>? detailImages = (json['detailImages'] as List<dynamic>?)
      ?.map(
          (e) => e)
      .toList();
  if (detailImages != null) {
    suInfo.detailImages = detailImages;
  }
  final List<ItemInfo>? itemInfos = (json['itemInfos'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<ItemInfo>(e) as ItemInfo).toList();
  if (itemInfos != null) {
    suInfo.itemInfos = itemInfos;
  }
  final SaleInfo? saleInfo = jsonConvert.convert<SaleInfo>(json['saleInfo']);
  if (saleInfo != null) {
    suInfo.saleInfo = saleInfo;
  }
  final FollowInfo? followInfo = jsonConvert.convert<FollowInfo>(
      json['followInfo']);
  if (followInfo != null) {
    suInfo.followInfo = followInfo;
  }
  final List<Sale>? saleInfos = (json['saleInfos'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<Sale>(e) as Sale).toList();
  if (saleInfos != null) {
    suInfo.saleInfos = saleInfos;
  }
  final List<TagInfo>? tagInfos = (json['tagInfos'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<TagInfo>(e) as TagInfo).toList();
  if (tagInfos != null) {
    suInfo.tagInfos = tagInfos;
  }
  final List<LadderPrice>? ladderPrice = (json['ladderPrice'] as List<dynamic>?)
      ?.map(
          (e) => jsonConvert.convert<LadderPrice>(e) as LadderPrice)
      .toList();
  if (ladderPrice != null) {
    suInfo.ladderPrice = ladderPrice;
  }
  final List<SuInfoVideo>? detailVideos = (json['detailVideos'] as List<
      dynamic>?)?.map(
          (e) => jsonConvert.convert<SuInfoVideo>(e) as SuInfoVideo).toList();
  if (detailVideos != null) {
    suInfo.detailVideos = detailVideos;
  }
  final int? startBatch = jsonConvert.convert<int>(json['startBatch']);
  if (startBatch != null) {
    suInfo.startBatch = startBatch;
  }
  return suInfo;
}

Map<String, dynamic> $SuInfoToJson(SuInfo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['title'] = entity.title;
  data['categoryId'] = entity.categoryId;
  data['categoryName'] = entity.categoryName;
  data['brandId'] = entity.brandId;
  data['brandName'] = entity.brandName;
  data['brandLogo'] = entity.brandLogo;
  data['sellingPointDesc'] = entity.sellingPointDesc;
  data['shippingInfo'] = entity.shippingInfo?.toJson();
  data['isCanCod'] = entity.isCanCod;
  data['sample'] = entity.sample;
  data['mainImages'] = entity.mainImages;
  data['specs'] = entity.specs?.map((v) => v.toJson()).toList();
  data['params'] = entity.params?.map((v) => v.toJson()).toList();
  data['textDesc'] = entity.textDesc;
  data['detailImages'] = entity.detailImages;
  data['itemInfos'] = entity.itemInfos?.map((v) => v.toJson()).toList();
  data['saleInfo'] = entity.saleInfo?.toJson();
  data['followInfo'] = entity.followInfo?.toJson();
  data['saleInfos'] = entity.saleInfos?.map((v) => v.toJson()).toList();
  data['tagInfos'] = entity.tagInfos?.map((v) => v.toJson()).toList();
  data['ladderPrice'] = entity.ladderPrice?.map((v) => v.toJson()).toList();
  data['detailVideos'] = entity.detailVideos?.map((v) => v.toJson()).toList();
  data['startBatch'] = entity.startBatch;
  return data;
}

extension SuInfoExtension on SuInfo {
  SuInfo copyWith({
    String? title,
    String? categoryId,
    String? categoryName,
    String? brandId,
    String? brandName,
    String? brandLogo,
    String? sellingPointDesc,
    ShippingInfo? shippingInfo,
    bool? isCanCod,
    bool? sample,
    List<String>? mainImages,
    List<SuInfoSpec>? specs,
    List<Param>? params,
    String? textDesc,
    List<dynamic>? detailImages,
    List<ItemInfo>? itemInfos,
    SaleInfo? saleInfo,
    FollowInfo? followInfo,
    List<Sale>? saleInfos,
    List<TagInfo>? tagInfos,
    List<LadderPrice>? ladderPrice,
    List<SuInfoVideo>? detailVideos,
    int? startBatch,
  }) {
    return SuInfo()
      ..title = title ?? this.title
      ..categoryId = categoryId ?? this.categoryId
      ..categoryName = categoryName ?? this.categoryName
      ..brandId = brandId ?? this.brandId
      ..brandName = brandName ?? this.brandName
      ..brandLogo = brandLogo ?? this.brandLogo
      ..sellingPointDesc = sellingPointDesc ?? this.sellingPointDesc
      ..shippingInfo = shippingInfo ?? this.shippingInfo
      ..isCanCod = isCanCod ?? this.isCanCod
      ..sample = sample ?? this.sample
      ..mainImages = mainImages ?? this.mainImages
      ..specs = specs ?? this.specs
      ..params = params ?? this.params
      ..textDesc = textDesc ?? this.textDesc
      ..detailImages = detailImages ?? this.detailImages
      ..itemInfos = itemInfos ?? this.itemInfos
      ..saleInfo = saleInfo ?? this.saleInfo
      ..followInfo = followInfo ?? this.followInfo
      ..saleInfos = saleInfos ?? this.saleInfos
      ..tagInfos = tagInfos ?? this.tagInfos
      ..ladderPrice = ladderPrice ?? this.ladderPrice
      ..detailVideos = detailVideos ?? this.detailVideos
      ..startBatch = startBatch ?? this.startBatch;
  }
}

FollowInfo $FollowInfoFromJson(Map<String, dynamic> json) {
  final FollowInfo followInfo = FollowInfo();
  final String? saleItemId = jsonConvert.convert<String>(json['saleItemId']);
  if (saleItemId != null) {
    followInfo.saleItemId = saleItemId;
  }
  final bool? isFollow = jsonConvert.convert<bool>(json['isFollow']);
  if (isFollow != null) {
    followInfo.isFollow = isFollow;
  }
  return followInfo;
}

Map<String, dynamic> $FollowInfoToJson(FollowInfo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['saleItemId'] = entity.saleItemId;
  data['isFollow'] = entity.isFollow;
  return data;
}

extension FollowInfoExtension on FollowInfo {
  FollowInfo copyWith({
    String? saleItemId,
    bool? isFollow,
  }) {
    return FollowInfo()
      ..saleItemId = saleItemId ?? this.saleItemId
      ..isFollow = isFollow ?? this.isFollow;
  }
}

SuInfoVideo $SuInfoVideoFromJson(Map<String, dynamic> json) {
  final SuInfoVideo suInfoVideo = SuInfoVideo();
  final String? imageUrl = jsonConvert.convert<String>(json['imageUrl']);
  if (imageUrl != null) {
    suInfoVideo.imageUrl = imageUrl;
  }
  final String? videoUrl = jsonConvert.convert<String>(json['videoUrl']);
  if (videoUrl != null) {
    suInfoVideo.videoUrl = videoUrl;
  }
  return suInfoVideo;
}

Map<String, dynamic> $SuInfoVideoToJson(SuInfoVideo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['imageUrl'] = entity.imageUrl;
  data['videoUrl'] = entity.videoUrl;
  return data;
}

extension SuInfoVideoExtension on SuInfoVideo {
  SuInfoVideo copyWith({
    String? imageUrl,
    String? videoUrl,
  }) {
    return SuInfoVideo()
      ..imageUrl = imageUrl ?? this.imageUrl
      ..videoUrl = videoUrl ?? this.videoUrl;
  }
}

LadderPrice $LadderPriceFromJson(Map<String, dynamic> json) {
  final LadderPrice ladderPrice = LadderPrice();
  final String? ladder = jsonConvert.convert<String>(json['ladder']);
  if (ladder != null) {
    ladderPrice.ladder = ladder;
  }
  final double? price = jsonConvert.convert<double>(json['price']);
  if (price != null) {
    ladderPrice.price = price;
  }
  return ladderPrice;
}

Map<String, dynamic> $LadderPriceToJson(LadderPrice entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['ladder'] = entity.ladder;
  data['price'] = entity.price;
  return data;
}

extension LadderPriceExtension on LadderPrice {
  LadderPrice copyWith({
    String? ladder,
    double? price,
  }) {
    return LadderPrice()
      ..ladder = ladder ?? this.ladder
      ..price = price ?? this.price;
  }
}

Param $ParamFromJson(Map<String, dynamic> json) {
  final Param param = Param();
  final String? paramName = jsonConvert.convert<String>(json['paramName']);
  if (paramName != null) {
    param.paramName = paramName;
  }
  final List<dynamic>? values = (json['values'] as List<dynamic>?)?.map(
          (e) => e).toList();
  if (values != null) {
    param.values = values;
  }
  return param;
}

Map<String, dynamic> $ParamToJson(Param entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['paramName'] = entity.paramName;
  data['values'] = entity.values;
  return data;
}

extension ParamExtension on Param {
  Param copyWith({
    String? paramName,
    List<dynamic>? values,
  }) {
    return Param()
      ..paramName = paramName ?? this.paramName
      ..values = values ?? this.values;
  }
}

SaleInfo $SaleInfoFromJson(Map<String, dynamic> json) {
  final SaleInfo saleInfo = SaleInfo();
  final String? currency = jsonConvert.convert<String>(json['currency']);
  if (currency != null) {
    saleInfo.currency = currency;
  }
  final String? displayCurrency = jsonConvert.convert<String>(
      json['displayCurrency']);
  if (displayCurrency != null) {
    saleInfo.displayCurrency = displayCurrency;
  }
  final int? moq = jsonConvert.convert<int>(json['moq']);
  if (moq != null) {
    saleInfo.moq = moq;
  }
  final int? minMoq = jsonConvert.convert<int>(json['minMoq']);
  if (minMoq != null) {
    saleInfo.minMoq = minMoq;
  }
  final int? maxMoq = jsonConvert.convert<int>(json['maxMoq']);
  if (maxMoq != null) {
    saleInfo.maxMoq = maxMoq;
  }
  final PriceRangeInfo? priceRangeInfo = jsonConvert.convert<PriceRangeInfo>(
      json['priceRangeInfo']);
  if (priceRangeInfo != null) {
    saleInfo.priceRangeInfo = priceRangeInfo;
  }
  final List<Sale>? saleSpecs = (json['saleSpecs'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<Sale>(e) as Sale).toList();
  if (saleSpecs != null) {
    saleInfo.saleSpecs = saleSpecs;
  }
  return saleInfo;
}

Map<String, dynamic> $SaleInfoToJson(SaleInfo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['currency'] = entity.currency;
  data['displayCurrency'] = entity.displayCurrency;
  data['moq'] = entity.moq;
  data['minMoq'] = entity.minMoq;
  data['maxMoq'] = entity.maxMoq;
  data['priceRangeInfo'] = entity.priceRangeInfo?.toJson();
  data['saleSpecs'] = entity.saleSpecs?.map((v) => v.toJson()).toList();
  return data;
}

extension SaleInfoExtension on SaleInfo {
  SaleInfo copyWith({
    String? currency,
    String? displayCurrency,
    int? moq,
    int? minMoq,
    int? maxMoq,
    PriceRangeInfo? priceRangeInfo,
    List<Sale>? saleSpecs,
  }) {
    return SaleInfo()
      ..currency = currency ?? this.currency
      ..displayCurrency = displayCurrency ?? this.displayCurrency
      ..moq = moq ?? this.moq
      ..minMoq = minMoq ?? this.minMoq
      ..maxMoq = maxMoq ?? this.maxMoq
      ..priceRangeInfo = priceRangeInfo ?? this.priceRangeInfo
      ..saleSpecs = saleSpecs ?? this.saleSpecs;
  }
}

PriceRangeInfo $PriceRangeInfoFromJson(Map<String, dynamic> json) {
  final PriceRangeInfo priceRangeInfo = PriceRangeInfo();
  final double? displayMinPrice = jsonConvert.convert<double>(
      json['displayMinPrice']);
  if (displayMinPrice != null) {
    priceRangeInfo.displayMinPrice = displayMinPrice;
  }
  final double? displayMaxPrice = jsonConvert.convert<double>(
      json['displayMaxPrice']);
  if (displayMaxPrice != null) {
    priceRangeInfo.displayMaxPrice = displayMaxPrice;
  }
  final double? displayMinSuggestedRetailPrice = jsonConvert.convert<double>(
      json['displayMinSuggestedRetailPrice']);
  if (displayMinSuggestedRetailPrice != null) {
    priceRangeInfo.displayMinSuggestedRetailPrice =
        displayMinSuggestedRetailPrice;
  }
  final double? displayMaxSuggestedRetailPrice = jsonConvert.convert<double>(
      json['displayMaxSuggestedRetailPrice']);
  if (displayMaxSuggestedRetailPrice != null) {
    priceRangeInfo.displayMaxSuggestedRetailPrice =
        displayMaxSuggestedRetailPrice;
  }
  final double? displayMinProfitPrice = jsonConvert.convert<double>(
      json['displayMinProfitPrice']);
  if (displayMinProfitPrice != null) {
    priceRangeInfo.displayMinProfitPrice = displayMinProfitPrice;
  }
  final double? displayMaxProfitPrice = jsonConvert.convert<double>(
      json['displayMaxProfitPrice']);
  if (displayMaxProfitPrice != null) {
    priceRangeInfo.displayMaxProfitPrice = displayMaxProfitPrice;
  }
  final double? displayPrice = jsonConvert.convert<double>(
      json['displayPrice']);
  if (displayPrice != null) {
    priceRangeInfo.displayPrice = displayPrice;
  }
  final bool? isActivityPrice = jsonConvert.convert<bool>(
      json['isActivityPrice']);
  if (isActivityPrice != null) {
    priceRangeInfo.isActivityPrice = isActivityPrice;
  }
  final double? activityPriceCurrency = jsonConvert.convert<double>(
      json['activityPriceCurrency']);
  if (activityPriceCurrency != null) {
    priceRangeInfo.activityPriceCurrency = activityPriceCurrency;
  }
  final double? originalDisplayMinSalePrice = jsonConvert.convert<double>(
      json['originalDisplayMinSalePrice']);
  if (originalDisplayMinSalePrice != null) {
    priceRangeInfo.originalDisplayMinSalePrice = originalDisplayMinSalePrice;
  }
  final double? originalDisplayMaxSalePrice = jsonConvert.convert<double>(
      json['originalDisplayMaxSalePrice']);
  if (originalDisplayMaxSalePrice != null) {
    priceRangeInfo.originalDisplayMaxSalePrice = originalDisplayMaxSalePrice;
  }
  final double? minPrice = jsonConvert.convert<double>(json['minPrice']);
  if (minPrice != null) {
    priceRangeInfo.minPrice = minPrice;
  }
  final double? maxPrice = jsonConvert.convert<double>(json['maxPrice']);
  if (maxPrice != null) {
    priceRangeInfo.maxPrice = maxPrice;
  }
  final int? moq = jsonConvert.convert<int>(json['moq']);
  if (moq != null) {
    priceRangeInfo.moq = moq;
  }
  return priceRangeInfo;
}

Map<String, dynamic> $PriceRangeInfoToJson(PriceRangeInfo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['displayMinPrice'] = entity.displayMinPrice;
  data['displayMaxPrice'] = entity.displayMaxPrice;
  data['displayMinSuggestedRetailPrice'] =
      entity.displayMinSuggestedRetailPrice;
  data['displayMaxSuggestedRetailPrice'] =
      entity.displayMaxSuggestedRetailPrice;
  data['displayMinProfitPrice'] = entity.displayMinProfitPrice;
  data['displayMaxProfitPrice'] = entity.displayMaxProfitPrice;
  data['displayPrice'] = entity.displayPrice;
  data['isActivityPrice'] = entity.isActivityPrice;
  data['activityPriceCurrency'] = entity.activityPriceCurrency;
  data['originalDisplayMinSalePrice'] = entity.originalDisplayMinSalePrice;
  data['originalDisplayMaxSalePrice'] = entity.originalDisplayMaxSalePrice;
  data['minPrice'] = entity.minPrice;
  data['maxPrice'] = entity.maxPrice;
  data['moq'] = entity.moq;
  return data;
}

extension PriceRangeInfoExtension on PriceRangeInfo {
  PriceRangeInfo copyWith({
    double? displayMinPrice,
    double? displayMaxPrice,
    double? displayMinSuggestedRetailPrice,
    double? displayMaxSuggestedRetailPrice,
    double? displayMinProfitPrice,
    double? displayMaxProfitPrice,
    double? displayPrice,
    bool? isActivityPrice,
    double? activityPriceCurrency,
    double? originalDisplayMinSalePrice,
    double? originalDisplayMaxSalePrice,
    double? minPrice,
    double? maxPrice,
    int? moq,
  }) {
    return PriceRangeInfo()
      ..displayMinPrice = displayMinPrice ?? this.displayMinPrice
      ..displayMaxPrice = displayMaxPrice ?? this.displayMaxPrice
      ..displayMinSuggestedRetailPrice = displayMinSuggestedRetailPrice ??
          this.displayMinSuggestedRetailPrice
      ..displayMaxSuggestedRetailPrice = displayMaxSuggestedRetailPrice ??
          this.displayMaxSuggestedRetailPrice
      ..displayMinProfitPrice = displayMinProfitPrice ??
          this.displayMinProfitPrice
      ..displayMaxProfitPrice = displayMaxProfitPrice ??
          this.displayMaxProfitPrice
      ..displayPrice = displayPrice ?? this.displayPrice
      ..isActivityPrice = isActivityPrice ?? this.isActivityPrice
      ..activityPriceCurrency = activityPriceCurrency ??
          this.activityPriceCurrency
      ..originalDisplayMinSalePrice = originalDisplayMinSalePrice ??
          this.originalDisplayMinSalePrice
      ..originalDisplayMaxSalePrice = originalDisplayMaxSalePrice ??
          this.originalDisplayMaxSalePrice
      ..minPrice = minPrice ?? this.minPrice
      ..maxPrice = maxPrice ?? this.maxPrice
      ..moq = moq ?? this.moq;
  }
}

Sale $SaleFromJson(Map<String, dynamic> json) {
  final Sale sale = Sale();
  final String? saleItemId = jsonConvert.convert<String>(json['saleItemId']);
  if (saleItemId != null) {
    sale.saleItemId = saleItemId;
  }
  final String? currency = jsonConvert.convert<String>(json['currency']);
  if (currency != null) {
    sale.currency = currency;
  }
  final double? salePrice = jsonConvert.convert<double>(json['salePrice']);
  if (salePrice != null) {
    sale.salePrice = salePrice;
  }
  final bool? display = jsonConvert.convert<bool>(json['display']);
  if (display != null) {
    sale.display = display;
  }
  final String? displayCurrency = jsonConvert.convert<String>(
      json['displayCurrency']);
  if (displayCurrency != null) {
    sale.displayCurrency = displayCurrency;
  }
  final double? displaySalePrice = jsonConvert.convert<double>(
      json['displaySalePrice']);
  if (displaySalePrice != null) {
    sale.displaySalePrice = displaySalePrice;
  }
  final double? displaySuggestedRetailPrice = jsonConvert.convert<double>(
      json['displaySuggestedRetailPrice']);
  if (displaySuggestedRetailPrice != null) {
    sale.displaySuggestedRetailPrice = displaySuggestedRetailPrice;
  }
  final double? displayProfitPrice = jsonConvert.convert<double>(
      json['displayProfitPrice']);
  if (displayProfitPrice != null) {
    sale.displayProfitPrice = displayProfitPrice;
  }
  final double? displayUnitPrice = jsonConvert.convert<double>(
      json['displayUnitPrice']);
  if (displayUnitPrice != null) {
    sale.displayUnitPrice = displayUnitPrice;
  }
  final int? moq = jsonConvert.convert<int>(json['moq']);
  if (moq != null) {
    sale.moq = moq;
  }
  final int? stockNum = jsonConvert.convert<int>(json['stockNum']);
  if (stockNum != null) {
    sale.stockNum = stockNum;
  }
  final int? quantityLimit = jsonConvert.convert<int>(json['quantityLimit']);
  if (quantityLimit != null) {
    sale.quantityLimit = quantityLimit;
  }
  final bool? isActivityPrice = jsonConvert.convert<bool>(
      json['isActivityPrice']);
  if (isActivityPrice != null) {
    sale.isActivityPrice = isActivityPrice;
  }
  final String? originalCurrency = jsonConvert.convert<String>(
      json['originalCurrency']);
  if (originalCurrency != null) {
    sale.originalCurrency = originalCurrency;
  }
  final double? originalSalePrice = jsonConvert.convert<double>(
      json['originalSalePrice']);
  if (originalSalePrice != null) {
    sale.originalSalePrice = originalSalePrice;
  }
  final double? originalDisplaySalePrice = jsonConvert.convert<double>(
      json['originalDisplaySalePrice']);
  if (originalDisplaySalePrice != null) {
    sale.originalDisplaySalePrice = originalDisplaySalePrice;
  }
  final int? stepQuantity = jsonConvert.convert<int>(json['stepQuantity']);
  if (stepQuantity != null) {
    sale.stepQuantity = stepQuantity;
  }
  final List<SpecInfo>? specInfos = (json['specInfos'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<SpecInfo>(e) as SpecInfo).toList();
  if (specInfos != null) {
    sale.specInfos = specInfos;
  }
  final String? imagePic = jsonConvert.convert<String>(json['imagePic']);
  if (imagePic != null) {
    sale.imagePic = imagePic;
  }
  final bool? onSale = jsonConvert.convert<bool>(json['onSale']);
  if (onSale != null) {
    sale.onSale = onSale;
  }
  final bool? sample = jsonConvert.convert<bool>(json['sample']);
  if (sample != null) {
    sale.sample = sample;
  }
  return sale;
}

Map<String, dynamic> $SaleToJson(Sale entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['saleItemId'] = entity.saleItemId;
  data['currency'] = entity.currency;
  data['salePrice'] = entity.salePrice;
  data['display'] = entity.display;
  data['displayCurrency'] = entity.displayCurrency;
  data['displaySalePrice'] = entity.displaySalePrice;
  data['displaySuggestedRetailPrice'] = entity.displaySuggestedRetailPrice;
  data['displayProfitPrice'] = entity.displayProfitPrice;
  data['displayUnitPrice'] = entity.displayUnitPrice;
  data['moq'] = entity.moq;
  data['stockNum'] = entity.stockNum;
  data['quantityLimit'] = entity.quantityLimit;
  data['isActivityPrice'] = entity.isActivityPrice;
  data['originalCurrency'] = entity.originalCurrency;
  data['originalSalePrice'] = entity.originalSalePrice;
  data['originalDisplaySalePrice'] = entity.originalDisplaySalePrice;
  data['stepQuantity'] = entity.stepQuantity;
  data['specInfos'] = entity.specInfos?.map((v) => v.toJson()).toList();
  data['imagePic'] = entity.imagePic;
  data['onSale'] = entity.onSale;
  data['sample'] = entity.sample;
  return data;
}

extension SaleExtension on Sale {
  Sale copyWith({
    String? saleItemId,
    String? currency,
    double? salePrice,
    bool? display,
    String? displayCurrency,
    double? displaySalePrice,
    double? displaySuggestedRetailPrice,
    double? displayProfitPrice,
    double? displayUnitPrice,
    int? moq,
    int? stockNum,
    int? quantityLimit,
    bool? isActivityPrice,
    String? originalCurrency,
    double? originalSalePrice,
    double? originalDisplaySalePrice,
    int? stepQuantity,
    List<SpecInfo>? specInfos,
    String? imagePic,
    bool? onSale,
    bool? sample,
  }) {
    return Sale()
      ..saleItemId = saleItemId ?? this.saleItemId
      ..currency = currency ?? this.currency
      ..salePrice = salePrice ?? this.salePrice
      ..display = display ?? this.display
      ..displayCurrency = displayCurrency ?? this.displayCurrency
      ..displaySalePrice = displaySalePrice ?? this.displaySalePrice
      ..displaySuggestedRetailPrice = displaySuggestedRetailPrice ??
          this.displaySuggestedRetailPrice
      ..displayProfitPrice = displayProfitPrice ?? this.displayProfitPrice
      ..displayUnitPrice = displayUnitPrice ?? this.displayUnitPrice
      ..moq = moq ?? this.moq
      ..stockNum = stockNum ?? this.stockNum
      ..quantityLimit = quantityLimit ?? this.quantityLimit
      ..isActivityPrice = isActivityPrice ?? this.isActivityPrice
      ..originalCurrency = originalCurrency ?? this.originalCurrency
      ..originalSalePrice = originalSalePrice ?? this.originalSalePrice
      ..originalDisplaySalePrice = originalDisplaySalePrice ??
          this.originalDisplaySalePrice
      ..stepQuantity = stepQuantity ?? this.stepQuantity
      ..specInfos = specInfos ?? this.specInfos
      ..imagePic = imagePic ?? this.imagePic
      ..onSale = onSale ?? this.onSale
      ..sample = sample ?? this.sample;
  }
}

SpecInfo $SpecInfoFromJson(Map<String, dynamic> json) {
  final SpecInfo specInfo = SpecInfo();
  final String? specName = jsonConvert.convert<String>(json['specName']);
  if (specName != null) {
    specInfo.specName = specName;
  }
  final String? specValue = jsonConvert.convert<String>(json['specValue']);
  if (specValue != null) {
    specInfo.specValue = specValue;
  }
  final String? specUnit = jsonConvert.convert<String>(json['specUnit']);
  if (specUnit != null) {
    specInfo.specUnit = specUnit;
  }
  return specInfo;
}

Map<String, dynamic> $SpecInfoToJson(SpecInfo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['specName'] = entity.specName;
  data['specValue'] = entity.specValue;
  data['specUnit'] = entity.specUnit;
  return data;
}

extension SpecInfoExtension on SpecInfo {
  SpecInfo copyWith({
    String? specName,
    String? specValue,
    String? specUnit,
  }) {
    return SpecInfo()
      ..specName = specName ?? this.specName
      ..specValue = specValue ?? this.specValue
      ..specUnit = specUnit ?? this.specUnit;
  }
}

ShippingInfo $ShippingInfoFromJson(Map<String, dynamic> json) {
  final ShippingInfo shippingInfo = ShippingInfo();
  final List<
      SkuShippingInfo>? skuShippingInfos = (json['skuShippingInfos'] as List<
      dynamic>?)
      ?.map(
          (e) => jsonConvert.convert<SkuShippingInfo>(e) as SkuShippingInfo)
      .toList();
  if (skuShippingInfos != null) {
    shippingInfo.skuShippingInfos = skuShippingInfos;
  }
  final bool? isLocalShipping = jsonConvert.convert<bool>(
      json['isLocalShipping']);
  if (isLocalShipping != null) {
    shippingInfo.isLocalShipping = isLocalShipping;
  }
  final String? shipsFrom = jsonConvert.convert<String>(json['shipsFrom']);
  if (shipsFrom != null) {
    shippingInfo.shipsFrom = shipsFrom;
  }
  return shippingInfo;
}

Map<String, dynamic> $ShippingInfoToJson(ShippingInfo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['skuShippingInfos'] =
      entity.skuShippingInfos?.map((v) => v.toJson()).toList();
  data['isLocalShipping'] = entity.isLocalShipping;
  data['shipsFrom'] = entity.shipsFrom;
  return data;
}

extension ShippingInfoExtension on ShippingInfo {
  ShippingInfo copyWith({
    List<SkuShippingInfo>? skuShippingInfos,
    bool? isLocalShipping,
    String? shipsFrom,
  }) {
    return ShippingInfo()
      ..skuShippingInfos = skuShippingInfos ?? this.skuShippingInfos
      ..isLocalShipping = isLocalShipping ?? this.isLocalShipping
      ..shipsFrom = shipsFrom ?? this.shipsFrom;
  }
}

SkuShippingInfo $SkuShippingInfoFromJson(Map<String, dynamic> json) {
  final SkuShippingInfo skuShippingInfo = SkuShippingInfo();
  final String? saleItemId = jsonConvert.convert<String>(json['saleItemId']);
  if (saleItemId != null) {
    skuShippingInfo.saleItemId = saleItemId;
  }
  final String? estimateWeight = jsonConvert.convert<String>(
      json['estimateWeight']);
  if (estimateWeight != null) {
    skuShippingInfo.estimateWeight = estimateWeight;
  }
  final String? estimateType = jsonConvert.convert<String>(
      json['estimateType']);
  if (estimateType != null) {
    skuShippingInfo.estimateType = estimateType;
  }
  final String? estimateFreight = jsonConvert.convert<String>(
      json['estimateFreight']);
  if (estimateFreight != null) {
    skuShippingInfo.estimateFreight = estimateFreight;
  }
  final EstimateShippingInfoVo? estimateShippingInfoVo = jsonConvert.convert<
      EstimateShippingInfoVo>(json['estimateShippingInfoVo']);
  if (estimateShippingInfoVo != null) {
    skuShippingInfo.estimateShippingInfoVo = estimateShippingInfoVo;
  }
  return skuShippingInfo;
}

Map<String, dynamic> $SkuShippingInfoToJson(SkuShippingInfo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['saleItemId'] = entity.saleItemId;
  data['estimateWeight'] = entity.estimateWeight;
  data['estimateType'] = entity.estimateType;
  data['estimateFreight'] = entity.estimateFreight;
  data['estimateShippingInfoVo'] = entity.estimateShippingInfoVo?.toJson();
  return data;
}

extension SkuShippingInfoExtension on SkuShippingInfo {
  SkuShippingInfo copyWith({
    String? saleItemId,
    String? estimateWeight,
    String? estimateType,
    String? estimateFreight,
    EstimateShippingInfoVo? estimateShippingInfoVo,
  }) {
    return SkuShippingInfo()
      ..saleItemId = saleItemId ?? this.saleItemId
      ..estimateWeight = estimateWeight ?? this.estimateWeight
      ..estimateType = estimateType ?? this.estimateType
      ..estimateFreight = estimateFreight ?? this.estimateFreight
      ..estimateShippingInfoVo = estimateShippingInfoVo ??
          this.estimateShippingInfoVo;
  }
}

EstimateShippingInfoVo $EstimateShippingInfoVoFromJson(
    Map<String, dynamic> json) {
  final EstimateShippingInfoVo estimateShippingInfoVo = EstimateShippingInfoVo();
  final String? internationalLpId = jsonConvert.convert<String>(
      json['internationalLpId']);
  if (internationalLpId != null) {
    estimateShippingInfoVo.internationalLpId = internationalLpId;
  }
  final String? internationalLpCode = jsonConvert.convert<String>(
      json['internationalLpCode']);
  if (internationalLpCode != null) {
    estimateShippingInfoVo.internationalLpCode = internationalLpCode;
  }
  final String? internationalLpName = jsonConvert.convert<String>(
      json['internationalLpName']);
  if (internationalLpName != null) {
    estimateShippingInfoVo.internationalLpName = internationalLpName;
  }
  final String? terminalLpId = jsonConvert.convert<String>(
      json['terminalLpId']);
  if (terminalLpId != null) {
    estimateShippingInfoVo.terminalLpId = terminalLpId;
  }
  final String? terminalLpCode = jsonConvert.convert<String>(
      json['terminalLpCode']);
  if (terminalLpCode != null) {
    estimateShippingInfoVo.terminalLpCode = terminalLpCode;
  }
  final String? terminalLpName = jsonConvert.convert<String>(
      json['terminalLpName']);
  if (terminalLpName != null) {
    estimateShippingInfoVo.terminalLpName = terminalLpName;
  }
  final String? countryCode = jsonConvert.convert<String>(json['countryCode']);
  if (countryCode != null) {
    estimateShippingInfoVo.countryCode = countryCode;
  }
  final String? city = jsonConvert.convert<String>(json['city']);
  if (city != null) {
    estimateShippingInfoVo.city = city;
  }
  final String? freight = jsonConvert.convert<String>(json['freight']);
  if (freight != null) {
    estimateShippingInfoVo.freight = freight;
  }
  final String? currency = jsonConvert.convert<String>(json['currency']);
  if (currency != null) {
    estimateShippingInfoVo.currency = currency;
  }
  return estimateShippingInfoVo;
}

Map<String, dynamic> $EstimateShippingInfoVoToJson(
    EstimateShippingInfoVo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['internationalLpId'] = entity.internationalLpId;
  data['internationalLpCode'] = entity.internationalLpCode;
  data['internationalLpName'] = entity.internationalLpName;
  data['terminalLpId'] = entity.terminalLpId;
  data['terminalLpCode'] = entity.terminalLpCode;
  data['terminalLpName'] = entity.terminalLpName;
  data['countryCode'] = entity.countryCode;
  data['city'] = entity.city;
  data['freight'] = entity.freight;
  data['currency'] = entity.currency;
  return data;
}

extension EstimateShippingInfoVoExtension on EstimateShippingInfoVo {
  EstimateShippingInfoVo copyWith({
    String? internationalLpId,
    String? internationalLpCode,
    String? internationalLpName,
    String? terminalLpId,
    String? terminalLpCode,
    String? terminalLpName,
    String? countryCode,
    String? city,
    String? freight,
    String? currency,
  }) {
    return EstimateShippingInfoVo()
      ..internationalLpId = internationalLpId ?? this.internationalLpId
      ..internationalLpCode = internationalLpCode ?? this.internationalLpCode
      ..internationalLpName = internationalLpName ?? this.internationalLpName
      ..terminalLpId = terminalLpId ?? this.terminalLpId
      ..terminalLpCode = terminalLpCode ?? this.terminalLpCode
      ..terminalLpName = terminalLpName ?? this.terminalLpName
      ..countryCode = countryCode ?? this.countryCode
      ..city = city ?? this.city
      ..freight = freight ?? this.freight
      ..currency = currency ?? this.currency;
  }
}

SuInfoSpec $SuInfoSpecFromJson(Map<String, dynamic> json) {
  final SuInfoSpec suInfoSpec = SuInfoSpec();
  final String? specName = jsonConvert.convert<String>(json['specName']);
  if (specName != null) {
    suInfoSpec.specName = specName;
  }
  final List<Value>? values = (json['values'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<Value>(e) as Value).toList();
  if (values != null) {
    suInfoSpec.values = values;
  }
  final String? specType = jsonConvert.convert<String>(json['specType']);
  if (specType != null) {
    suInfoSpec.specType = specType;
  }
  return suInfoSpec;
}

Map<String, dynamic> $SuInfoSpecToJson(SuInfoSpec entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['specName'] = entity.specName;
  data['values'] = entity.values?.map((v) => v.toJson()).toList();
  data['specType'] = entity.specType;
  return data;
}

extension SuInfoSpecExtension on SuInfoSpec {
  SuInfoSpec copyWith({
    String? specName,
    List<Value>? values,
    String? specType,
  }) {
    return SuInfoSpec()
      ..specName = specName ?? this.specName
      ..values = values ?? this.values
      ..specType = specType ?? this.specType;
  }
}

Value $ValueFromJson(Map<String, dynamic> json) {
  final Value value = Value();
  final String? valueId = jsonConvert.convert<String>(json['valueId']);
  if (valueId != null) {
    value.valueId = valueId;
  }
  final String? valueName = jsonConvert.convert<String>(json['valueName']);
  if (valueName != null) {
    value.valueName = valueName;
  }
  final String? imageUrl = jsonConvert.convert<String>(json['imageUrl']);
  if (imageUrl != null) {
    value.imageUrl = imageUrl;
  }
  final List<dynamic>? includeItemIds = (json['includeItemIds'] as List<
      dynamic>?)?.map(
          (e) => e).toList();
  if (includeItemIds != null) {
    value.includeItemIds = includeItemIds;
  }
  return value;
}

Map<String, dynamic> $ValueToJson(Value entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['valueId'] = entity.valueId;
  data['valueName'] = entity.valueName;
  data['imageUrl'] = entity.imageUrl;
  data['includeItemIds'] = entity.includeItemIds;
  return data;
}

extension ValueExtension on Value {
  Value copyWith({
    String? valueId,
    String? valueName,
    String? imageUrl,
    List<dynamic>? includeItemIds,
  }) {
    return Value()
      ..valueId = valueId ?? this.valueId
      ..valueName = valueName ?? this.valueName
      ..imageUrl = imageUrl ?? this.imageUrl
      ..includeItemIds = includeItemIds ?? this.includeItemIds;
  }
}

TagInfo $TagInfoFromJson(Map<String, dynamic> json) {
  final TagInfo tagInfo = TagInfo();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    tagInfo.id = id;
  }
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    tagInfo.name = name;
  }
  return tagInfo;
}

Map<String, dynamic> $TagInfoToJson(TagInfo entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['name'] = entity.name;
  return data;
}

extension TagInfoExtension on TagInfo {
  TagInfo copyWith({
    String? id,
    String? name,
  }) {
    return TagInfo()
      ..id = id ?? this.id
      ..name = name ?? this.name;
  }
}